
//异步中不能用return 
//异步不能try-catch 执行栈不同
const fs = require('fs')
fs.readFile('../1.txt', 'utf8', function(err, data1) {
  if (err) {
    console.log(err)
  } else {
    fs.readFile('../2.txt', 'utf8', function(err, data) {
      if (err) {
        console.log(err)
      } else {
        return data.toString() + data1.toString()
      }
    })
  }
})
const Eevent = require('../event')

let listen = new Eevent();

function done (name) {
  console.log(`${name}123`)
}
function done2 (name, name2) {
  console.log(`${name}${name2}`)
}
listen.once('click1', done)
listen.on('click', done2)
// listen.emit('click', 'xjh', 'wyx')
// listen.emit('click', 'w', 'y')
listen.emit('click1', '王烨鑫')
listen.emit('click1', '王烨鑫')
listen.removeListen('smile');